package com.ssm.annotation;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

@Controller("userController")
//相当于配置文件中的:<bean id="userController" class="com.ssm.annotation.UserController" />

public class UserController {
    @Resource(name = "userService")
    //当于配置文件中的:<property name="userService"  ref="userService"/>

    private UserService userService;

    public void save() {
        this.userService.save();
        System.out.println("userController...save...");
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }
}